package com.loopy.servlet.servletContext;

import javax.servlet.ServletContext;

public class WebUtils {
    public static  Integer visitCount(ServletContext servletContext){
        Object visit_count = servletContext.getAttribute("visit_count");
        if(visit_count==null){
            servletContext.setAttribute("visit_count",1);
            visit_count=1;
        }else{
            visit_count=Integer.parseInt(visit_count+"")+1;
            servletContext.setAttribute("visit_count",visit_count);
        }
        return (Integer) visit_count;
    }
}
